<template>
  <div class="box">
    <el-breadcrumb separator=">">
      <el-breadcrumb-item to="/login" replace>首页</el-breadcrumb-item>
      <el-breadcrumb-item to="/login/user" replace>用户管理</el-breadcrumb-item>
      <el-breadcrumb-item>提额{{text}}</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="tableBox">
      <div class="tableTitle">提额{{text}}</div>
      <el-table :data="tableData">
        <el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
        <el-table-column prop="userId" label="用户编号" align="center"></el-table-column>
        <el-table-column prop="" label="用户账号" align="center"></el-table-column>
        <el-table-column prop="" label="姓名" align="center"></el-table-column>
        <el-table-column label="资产详情" align="center">
          <template slot-scope="data">
            <router-link :to="{path: 'user/userMoneyInfo', query: {userId: data.row.userId}}">查看</router-link>
          </template>
        </el-table-column>
        <el-table-column prop="" label="账户余额" align="center"></el-table-column>
        <el-table-column prop="" label="理财账户余额" align="center"></el-table-column>
        <el-table-column prop="" label="理财投资金额" align="center"></el-table-column>
        <el-table-column label="信审资料" align="center">
          <template slot-scope="data">
            <router-link :to="{path: 'user/userInfo', query: {userId: data.row.userId}}">查看</router-link>
          </template>
        </el-table-column>
        <el-table-column label="同盾报告" align="center">
          <template slot-scope="data">
            <router-link :to="{path: 'user/userTongDunInfo', query: {userId: data.row.userId}}">查看</router-link>
          </template>
        </el-table-column>
        <el-table-column label="运营商认证" align="center">
          <template slot-scope="data">
            <router-link :to="{path: 'user/userOperator', query: {userId: data.row.userId}}">查看</router-link>
          </template>
        </el-table-column>
        <el-table-column label="邮箱账单" align="center">
          <template slot-scope="data">
            <router-link :to="{path: 'user/userEmailBill', query: {userId: data.row.userId}}">查看</router-link>
          </template>
        </el-table-column>
        <el-table-column label="手机通讯录" align="center">
          <template slot-scope="data">
            <router-link :to="{path: 'user/userCallHistory', query: {userId: data.row.userId}}">查看</router-link>
          </template>
        </el-table-column>
        <el-table-column prop="" label="信用评分" align="center"></el-table-column>
        <el-table-column prop="" label="信用额度" align="center"></el-table-column>
        <el-table-column label="信息变更项" align="center">
          <template slot-scope="data">
            <router-link :to="{path: 'user/userIncreaseInfo', query: {userId: data.row.userId}}">查看</router-link>
          </template>
        </el-table-column>
        <el-table-column label="变更审核记录" align="center">
          <template slot-scope="data">
            <router-link :to="{path: 'user/userIncreaseCheck', query: {userId: data.row.userId}}">查看</router-link>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center">
          <el-table-column label="操作" align="center">
            <template slot-scope="data">
              <span class="colors" @click="examinationPassed(data.row)">通过</span>
              /
              <span @click="auditRejection(data.row)">拒绝</span>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <pagination :maxTotal="maxTotal" @handleSize="handleSizeChange" @handleCurrent="handleCurrentChange"></pagination>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
  import pagination from 'components/pagination'

  export default {
    data () {
      return {
        maxTotal: 10,
        tableData: []
      }
    },
    computed: {
      text () {
        if (+this.$route.query.state === 1) return '初审'
        if (+this.$route.query.state === 2) return '终审'
      }
    },
    created () {
    },
    methods: {
      examinationPassed (item) {
      },
      auditRejection (item) {
        this.$prompt('', '拒绝原因', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          inputPlaceholder: '不得超过20个字',
          inputPattern: /[\u4e00-\u9fa5]+/,
          inputValidator (value) {
            if (value.length > 20) {
              return '不得超过20个字'
            }
            return true
          },
          inputErrorMessage: '请输入文字拒绝原因'
        }).then(({value}) => {
          this.$message({
            type: 'success',
            message: '你的邮箱是: ' + value,
            center: true
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '取消输入',
            center: true
          })
        })
      },
      handleSizeChange (val) {
      },
      handleCurrentChange (val) {
      }
    },
    components: {
      pagination
    }
  }
</script>

<style lang="less" ref="stylesheet/less" scoped>

</style>
